<% systemUrl = resData.system_obj_urls %>
<% allPost = resData.allPost %>
<% newPost = resData.newPost %>
<div class="index-page">
    <% if(resData.isLogin !== true){ %>
        <div class="sign-part">
            <div class="content">
                <div class="sign-form">
                    <div class="sign-form-cg">
                        <span class="signToggle active" data-cls="sign_reg">登录/注册</span>
                        <span class="signToggle" data-cls="sign_pwd">密码登录</span>
                    </div>
                    <form class="layui-form sign_reg" onsubmit="return false">
                        <div class="layui-form-item">
                            <input type="text" name="account" class="layui-input" required lay-verify="account" placeholder="手机号/邮箱" autocomplete="off">
                        </div>
                        <div class="layui-form-item code">
                            <input type="text" name="validateCode" class="layui-input min" required lay-verify="required" placeholder="验证码" autocomplete="off">
                            <button class="layui-btn min getValidateCode" type="button" data-type="2">获取</button>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn layui_submit sign_reg_btn" type="button" lay-submit lay-filter="sign_reg_btn">登录/注册</button>
                        </div>
                    </form>
                    <form class="layui-form sign_pwd hidden" onsubmit="return false">
                        <div class="layui-form-item">
                            <input type="text" name="account" class="layui-input" required lay-verify="required" placeholder="手机号/邮箱" autocomplete="off">
                        </div>
                        <div class="layui-form-item">
                            <input type="password" name="password" class="layui-input min" required lay-verify="required" placeholder="密码" autocomplete="off">
                            <i class="pwd-icon-close togglePwdEye"></i>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn layui_submit sign_pwd_btn" type="button" lay-submit lay-filter="sign_pwd_btn">登录</button>
                        </div>
                    </form>
                    <div class="sign-form-ag">
                        注册即代表同意[51语言<a href="<%= systemUrl['yu'] %>/agreement.html" target="_blank">用户协议</a>及<a href="<%= systemUrl['yu'] %>/secret.html" target="_blank">隐私协议</a>]
                    </div>
                </div>
            </div>
        </div>
    <% } %>
<!--    搜索-->
    <div class="content search-part">
        <form class="layui-form search-form" onsubmit="return false">
            <input type="text" name="searchPost" class="layui-input" placeholder="请输入期望的工作职位">
            <button class="layui-btn layui_submit" type="button" lay-submit lay-filter="search_post">搜 索</button>
        </form>
        <div class="search-hot searchHot"></div>
    </div>
<!--    筛选-->
    <div class="content filter-part filterPart">
        <div class="layui-row">
            <aside class="layui-col-md4 filterAsideMenu filter-aside-menu filter-menu-hidden">
                <% if(allPost.length){ %>
                    <% if(allPost.length > 5){ %>
                        <div class="show-all-post">
                            <a class="showFilterPost" href="javascript:;">查看全部职位</a>
                        </div>
                    <% } %>
                    <div class="filter-div-menu filterDivMenu">
                        <% for(var i = 0, len = allPost.length; i<len; i++){ %>
                            <% var item = allPost[i] %>
                            <% var sysPositions = item.sysPositions || [] %>
                            <div class="item layui-icon layui-icon-right">
                                <span class="sort title"><%= item.name %></span>
                                <% for(var j = 0, lenJ = sysPositions.length; j<lenJ; j++){ %>
                                    <% var itemJ = sysPositions[j] %>
                                    <a class="sort" href="/post?post_2nd=<%= itemJ.positionCode %>" target="_blank"><%= itemJ.name %></a>
                                <% } %>
                            </div>
                        <% } %>
                    </div>
                <% } %>
            </aside>
            <div class="filter-cnt filterCnt">
                <% for(var i = 0, len = allPost.length; i<len; i++){ %>
                    <% var item = allPost[i] %>
                    <% var sysPositions = item.sysPositions || [] %>
                    <section class="item">
                        <% for(var j = 0, lenJ = sysPositions.length; j<lenJ; j++){ %>
                            <% var itemJ = sysPositions[j] %>
                            <% var sysPositionsJ = itemJ.sysPositions || [] %>
                            <div class="title"><%= itemJ.name %></div>
                            <div class="cnt">
                                <a class="sort" href="/post?post_2nd=<%= itemJ.positionCode %>" target="_blank">全部</a>
                                <% for(var k = 0, lenK = sysPositionsJ.length; k<lenK; k++){ %>
                                    <% var itemK = sysPositionsJ[k] %>
                                    <a class="sort" href="/post?post_3rd=<%= itemK.positionCode %>" target="_blank"><%= itemK.name %></a>
                                <% } %>
                            </div>
                        <% } %>
                    </section>
                <% } %>
            </div>
            <div class="layui-col-md8 filter-carousel">
                <div class="layui-carousel carousel">
                    <div carousel-item>
                        <div style="background-image: url('/public/images/index/filter-banner-1.jpg');"></div>
                        <div style="background-image: url('/public/images/index/filter-banner-2.jpg');"></div>
                        <div style="background-image: url('/public/images/index/filter-banner-3.jpg');"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!--    最新职位-->
    <div class="content newest-post newestPost">
        <div class="title">最新职位 <a class="float-r" href="/post">查看全部</a></div>
        <% if(newPost.length){ %>
            <div class="list">
                <% for(var i = 0, len = newPost.length; i<len; i++){ %>
                    <% var item = newPost[i] %>
                    <% var company = item.company || {} %>
                    <div class="item <%= item.isExpatriate ? 'wp' : '' %>">
                        <div class="title">
                            <a href="/post/<%= item.positionCode %>.html" target="_blank">
                                <h3 class="post float-l txt-ellipsis"><%= item.positionTitle %></h3>
                            </a>
                            <span class="location float-l"><%= item.city.indexOf('市') >= 0 ? item.city.slice(0,-1) : item.city %></span>
                            <span class="salary float-r"><%= item.salaryFloor/1000 %>K-<%= item.salaryCeiling/1000 %>K<%= item.unit %></span>
                        </div>
                        <div class="post-short"><%= item.positionProperty %> / <%= item.language %> / <%= item.experience %> / <%= item.degree %></div>
                        <div class="company">
                            <a href="/post/company/<%= company.id %>.html" target="_blank">
                                <%- company.logoUrl
                                        ? '<img src="'+company.logoUrl+'" alt="">'
                                        : '<div class="short-name">'+ company.companySimpleName.slice(0,4) +'</div>'
                                %>
                            </a>
                            <div class="name"><a href="/post/company/<%= company.id %>.html" target="_blank"><%= company.companyName %></a></div>
                            <div class="scale"><%= company.companyProperty %> / <%= company.scale %></div>
                        </div>
                    </div>
                <% } %>
            </div>
        <% } else{ %>
            <div class="data-empty"></div>
        <% } %>
    </div>
<!--        合作单位-->
    <div class="cooperation">
        <div class="content">
            <div class="title">合作单位</div>
            <div class="scroll-slider cooperSlider">
                <div class="scroll-slider-items"></div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/public/js/modules/index.js"></script>
